home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1992 June: ROMin Holiday / ADC Developer CD (1992-06) (''ROMin Holiday'')_iso / Developer Connection - 06-1992.iso / Periodicals / develop / develop 10 code / LWFontUtility / NamerUtilDev / UTIL.h < prev    next >
Encoding:
C/C++ Source or Header  |  1992-04-08  |  5.8 KB  |  122 lines  |  [TEXT/MPS ]

  1. /*
  2.     File:        UTIL.h
  3.  
  4.     Contains:    Constant and structure definitions for the LaserWriter Font Utility UTILs.
  5.  
  6.     Written by:    Bryan K. Ressler (Beaker)
  7.  
  8.     Copyright:    © 1988-1991 by Apple Computer, Inc., all rights reserved.
  9. */
  10.  
  11. /* --- Return codes ------------------------------------------------------------------- */
  12. #define urNoAction        0x00000000    /* No action by the LWFU is required */
  13. #define urCheckDriver    0x00000001    /* Recheck the currently selected printer driver */
  14. #define urCheckPrinter    0x00000002    /* Recheck the currently selected printer */
  15. #define urCheckFeatures    0x00000004    /* Recheck features of currently selected printer */
  16. #define urEraseLists    0x00000008    /* Erase all fonts lists */
  17. #define urWaitOnPrinter    0x40000000    /* Wait for the printer to become ready */
  18. #define urError            0x80000000    /* The Prime routine encountered an error */
  19.  
  20. /* --- EOF codes for DoWrite ---------------------------------------------------------- */
  21. #define    sendEOF                1        /* send EOF to the LaserWriter, after the data */
  22. #define dontSendEOF            0
  23.  
  24. /* --- Printer classes ---------------------------------------------------------------- */
  25. #define    classA                0        /* for the printerClass field of LWFUPrinterInfo */
  26. #define classB                1
  27. #define classC                2
  28.  
  29. /* --- Error return values ------------------------------------------------------------ */
  30. #define printerError        1000    /* OpenPrinter couldn't open the printer */
  31.  
  32. /* --- Structure definitions ---------------------------------------------------------- */
  33. typedef struct {
  34.     FSSpec        theDriver;                /* File spec of the current driver */
  35.     Boolean        driverHasTrueType;        /* True if the driver understands TrueType */
  36. } LWFUDriverInfo;
  37.  
  38. typedef struct {
  39.     char        *currentPrinterName;    /* Name of the current printer (Pascal) */
  40.     THPrint        printRecord;            /* LWFU’s print record */
  41.     Boolean        printerHasCartridge;    /* True if the current printer has a cartridge */
  42.     Boolean        diskPresent;            /* True if a disk is attached to the printer */
  43.     Boolean        diskInitialized;        /* True if the disk is initialized */
  44.     Boolean        mayHaveDisk;            /* True if we may have a disk but we’re not sure */
  45.     Boolean        distinguishesDisks;        /* True if the individual disks are accessible */
  46.     Boolean        hasCompFonts;            /* True if the printer does composite fonts */
  47.     Boolean        scalerPresent;            /* True if the TrueType scaler is present in VM */
  48.     Boolean        sysStartPatched;        /* True if the Sys/Start file has been patched */
  49.     short        printerClass;            /* Either classA, classB, or classC */
  50.     short        printerDisksPresent;    /* Disks available - SCSI 0 is bit 0, etc. */
  51. } LWFUPrinterInfo;
  52.  
  53. typedef struct {
  54.     char        privates[76];            /* Quickdraw private stuff */
  55.     long        randSeed;                /* The usual Quickdraw globals */
  56.     BitMap        screenBits;
  57.     Cursor        arrow;
  58.     Pattern        dkGray;
  59.     Pattern        ltGray;
  60.     Pattern        gray;
  61.     Pattern        black;
  62.     Pattern        white;
  63.     GrafPtr        thePort;
  64. } QDGlobals;
  65.  
  66. typedef struct {
  67.     char        *PAPReadBuffer;            /* The PAP read buffer */
  68.     long        readBufferSize;            /* The size of the PAP read buffer in bytes */
  69.     char        *PAPWriteBuffer;        /* The PAP write buffer */
  70.     long        writeBufferSize;        /* The size of the PAP write buffer in bytes */
  71.     QDGlobals    *qd;                    /* A pointer to the LWFU's QuickDraw globals */
  72.     /* PAP Routines */
  73.     ProcPtr        OpenPrinter;            /* Open a connection */
  74.     ProcPtr        DoWrite;                /* Read from and write to the printer */
  75.     ProcPtr        ClosePrinter;            /* Close a connection */
  76.     /* Dialog utilities */
  77.     ProcPtr        CenterDialog;            /* Center dialogs on main screen */
  78.     ProcPtr        PositionAlert;            /* Correctly position alerts on main screen */
  79.     ProcPtr        UseCursor;                /* Install a cursor from a CURS resource */
  80.     ProcPtr        GetPText;                /* Copy text of dialog item into Pascal string */
  81.     ProcPtr        SetPText;                /* Put given Pascal string into a dialog item */
  82.     ProcPtr        GetNumText;                /* Get a number from a dialog text item */
  83.     ProcPtr        SetNumText;                /* Put a number into a dialog text item */
  84.     ProcPtr        GetValue;                /* Return the value of a control dialog item */
  85.     ProcPtr        SetValue;                /* Set the value of a control dialog item */
  86.     ProcPtr        EnCtrl;                    /* Enable a specified control dialog item */
  87.     ProcPtr        DisCtrl;                /* Disable a specified control dialog item */
  88.     ProcPtr        SetControlPName;        /* Set a control’s title from a Pascal string */
  89.     ProcPtr        FullSel;                /* Select all the text in a given editText item */
  90.     ProcPtr        InvalItem;                /* Invalidate the bounds of a dialog item */
  91.     ProcPtr        UserItem;                /* Install a userItem procedure */
  92.     ProcPtr        GrayLineItem;            /* Dialog userItem to draw gray lines */
  93.     ProcPtr        BoldOutlineItem;        /* Dialog userItem to outline a default button */
  94.     ProcPtr        RectItem;                /* Dialog userItem to draw a box */
  95.     /* String utilities */
  96.     ProcPtr        Pstrcat;                /* Concatenate one Pascal string to another */
  97.     ProcPtr        Pstrcpy;                /* Copy one Pascal string to another */
  98.     ProcPtr        GetAndAppend;            /* Append a string from a STR# to a string */
  99.     ProcPtr        ConvertAndAppend;        /* Convert convert to ASCII and append a number */
  100. } LWFUCallBackInfo;
  101.  
  102. typedef struct {
  103.     short                version;        /* The version of this record (1) */
  104.     short                resSpace;        /* The first ID in this UTIL's resource space */
  105.     long                uStorage;        /* put a handle to UTIL private storage here */
  106.     LWFUDriverInfo        *driverInfo;    /* Info about the current printer driver */
  107.     LWFUPrinterInfo        *printerInfo;    /* Info about the current printer */
  108.     LWFUCallBackInfo    *callBacks;        /* Buffers and callbacks into the LWFU */
  109. } LWFUParmBlk;
  110.  
  111. typedef struct {
  112.     short    version;                    /* The version of this resource */
  113.     short    resSpace;                    /* The first ID in this UTIL's resource space */
  114.     long    Utility_Open;                /* The offset to the Open routine */
  115.     long    Utility_Delta;                /* The offset to the Delta routine */
  116.     long    Utility_Prime;                /* The offset to the Prime routine */
  117.     long    Utility_Close;                /* The offset to the Close routine */
  118. /*    char    Data;    */                    /* The code */
  119. } UTILRec, *UTILPtr, **UTILHdl;
  120.  
  121. typedef pascal short UTILBufferRoutine(short length,LWFUParmBlk *pb);
  122.